<%--
  Created by IntelliJ IDEA.
  User: 12452
  Date: 2021/5/6
  Time: 20:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <table align="center" border="1px" width="60%" >
        <tr align="center">
            <td>编号</td>
            <td>职位</td>
            <td>姓名</td>
            <td>入职时间</td>
            <td>薪资</td>
            <td>操作</td>
        </tr>

        <c:forEach items="${requestScope.list}" var="emp">
            <tr align="center">
                <td>${emp.empno}</td>
                <td>${emp.job}</td>
                <td>${emp.ename}</td>
                <td>${emp.hireDate}</td>
                <td>${emp.sal}</td>
                <td>
                    <a href="/emp/delete?empno=${emp.empno}">删除</a>
                    <a href="/emp/beforeUpdate?empno=${emp.empno}&job=${emp.job}&ename=${emp.ename}&hireDate=${emp.hireDate}&sal=${emp.sal}">修改</a>
                </td>
            </tr>
        </c:forEach>

        <tr align="center">
            <td colspan="6">
                <a href="/emp/listByPage?page=1">首页</a>&nbsp;&nbsp;
                <c:if test="${requestScope.pageInfo.pageNum > 1}">
                    <a href="/emp/listByPage?page=${requestScope.pageInfo.pageNum - 1}">上一页</a>&nbsp;&nbsp;
                </c:if>
                <c:if test="${requestScope.pageInfo.pageNum < requestScope.pageInfo.pages}">
                    <a href="/emp/listByPage?page=${requestScope.pageInfo.pageNum + 1}">下一页</a>&nbsp;&nbsp;
                </c:if>
                <a href="/emp/listByPage?page=${requestScope.pageInfo.pages}">尾页</a>
            </td>
        </tr>
    </table>
</body>
</html>
